package com.cloudcc.mobile.entity;

import java.io.Serializable;

import android.text.TextUtils;

import com.cloudcc.mobile.manager.ContactsManager;

/** 
* @Description: 同事对象
* @author wangzhiqiang
* @date 2015-12-8 下午3:55:15 
*  
*/
public class CoworkerEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String name; // 名字
	private String sortLetters; // 显示数据拼音的首字母
	private String phone;// 电话
	private String fax;// 传真
	private String mobile;// 手机
	private String email;// 电子邮件
	private String title;// 职位
	private String company;// 公司
	private String department;// 部门
	private String country;// 国家
	private String postalcode;// 邮政编码
	private String city;// 城市
	private String shengri;// 生日
	private String xingbie;// 性别
	private String employeenum;// 员工编号
	private boolean ismefollow;
	private boolean isfollowme;
	//登录帐号
	private String loginname;
	
	

	public boolean isIsmefollow() {
		return ismefollow;
	}

	public void setIsmefollow(boolean ismefollow) {
		this.ismefollow = ismefollow;
	}

	public boolean isIsfollowme() {
		return isfollowme;
	}

	public void setIsfollowme(boolean isfollowme) {
		this.isfollowme = isfollowme;
	}

	
	public CoworkerEntity(String name, String sortLetters, String phone, String fax,
			String mobile, String email, String title, String company,
			String department, String country, String postalcode, String city,
			String shengri, String xingbie, String employeenum, String id) {
		super();
		this.name = name;
		this.sortLetters = sortLetters;
		this.phone = phone;
		this.fax = fax;
		this.mobile = mobile;
		this.email = email;
		this.title = title;
		this.company = company;
		this.department = department;
		this.country = country;
		this.postalcode = postalcode;
		this.city = city;
		this.shengri = shengri;
		this.xingbie = xingbie;
		this.employeenum = employeenum;
		this.id = id;
	}

	public CoworkerEntity() {
		super();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSortLetters() {
		return sortLetters==null?"":sortLetters;
	}

	public void setSortLetters(String sortLetters) {
		this.sortLetters = sortLetters;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getPostalcode() {
		return postalcode;
	}

	public void setPostalcode(String postalcode) {
		this.postalcode = postalcode;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getShengri() {
		return shengri;
	}

	public void setShengri(String shengri) {
		this.shengri = shengri;
	}

	public String getXingbie() {
		return xingbie;
	}

	public void setXingbie(String xingbie) {
		this.xingbie = xingbie;
	}

	public String getEmployeenum() {
		return employeenum;
	}

	public void setEmployeenum(String employeenum) {
		this.employeenum = employeenum;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	


	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}

	public String getNick() {
		return name;
	}
	
	public String getUsername() {
		return getHxusername();
	}
	public String getHxusername() {
		return ContactsManager.getInstance().encodeHXuserName(id);
	}

	@Override
	public String toString() {
		return loginname + ":" + name;
	}

	
	/** 获取用户的 简称 名称
	 * @return
	 */
	public String getNickRowName(){
		if (TextUtils.isEmpty(name)) {
			return ""; 
		}
		if (name.length()<=2) {
			return name;
		}else{
			return name.substring(name.length()-2, name.length());
		}
		
	}
}
